package com.heima.kafka.listener;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

/**
 * @author JianKang
 * @create 2023-10-27 21:51
 */
@Component
public class HelloListener {

    @KafkaListener(topics = {"itcast-topic"})
    public void onMessage(String messager) {
        if (!StringUtils.isEmpty(messager)) {
            System.out.println(messager);
        }
    }
}
